package com.example.management.api;

import com.example.management.ListLikeResult;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import rx.Observable;

public interface Api {

//    String API_URL = "http://10.0.2.2:8090/erp/";
    String API_URL = "http://192.168.56.1:8090/erp/";

    @FormUrlEncoded
    @POST("rawMeterial/add")
    Observable<Object> addRawMeterial(@Field("id") int id, @Field("name") String name, @Field("type") String type, @Field("supplierId") int supplierId);

    @GET("rawMeterial/list/{page}/{size}")
    Observable<ListLikeResult> getListPage(@Path("page") int page, @Path("size") int size);

    @GET("rawMeterial/list/name/{page}/{size}")
    Observable<Object> getListPageLike(@Path("page") int page,@Path("size") int size);

    @FormUrlEncoded
    @POST("rawMeterial/update")
    Observable<Object> updateRawMeterial(@Field("id") int id, @Field("name") String name, @Field("type") String type, @Field("supplierId") int supplierId);

    @FormUrlEncoded
    @POST("rawMeterial/list/delete")
    Observable<Object> deleteRawMeterial(@Field("idArray[]") Integer... id);
}
